<template>
	<view class='container prescription'>
	  <view class='prescription_con' v-for="(item,index) in prescription" :key='index'>
		<text class='bumber_top'>No.{{item.num}}</text>
		<view class='prescription_con_title'>普通处方签</view>
		<view class='prescription_info'>
		  <text>姓名：刘芳</text>
		  <text>性别：女</text>
		  <text>年龄：28</text>
		  <text>诊断：支气管炎  </text>
		  <text>201年9月18日</text>
		</view>
		<view class='prescription_con_middle'>
		  <text class='r'>R:</text>
		  <view class='con_middle_li' v-for="(item,index) in item.drugname" :key='index'>
			<text>{{item.name}}</text>
			<text>100ml100ml100ml/瓶</text>
			<text>口服，口服，一次5ml，一日三次</text>
		  </view>
		</view>
		<view class='prescription_seal'>
		  <view class='prescription_seal_li'>
			<text class='title'>医师：</text>
			<view class='seal' v-if="seal">
			  <text>黄先明</text>
			  <text>电子专用章</text>
			  <text>20190312131533</text>
			</view>
		  </view>
		  <view class='prescription_seal_li'>
			<text class='title'>审核：</text>
	 
		  </view>
		  <view class='prescription_seal_li'>
			<text class='title'>调配：</text>
			
		  </view>
		  <view class='prescription_seal_li'>
			<view class='qy'>
			  <text>核对</text>
			  <text>取药</text>
			</view>
	 
		  </view>
		</view>
		<view class='prescription_single_B'>
		  <text>1.服药期间禁止饮酒及辛辣食品。</text>
		  <text>2.服药前请仔细阅读药品使用说明书并按照说明或医师的指导下购买使用。</text>
		</view>
	  </view>
		<!-- 生成处方 -->
	  <button class='generate_button' @tap='start_seal'>{{sealname}}</button>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				seal:false,  //电子盖章
				sealname:'电子盖章',
				prescription:[
				  {
					num:'6956565321456',
					drugname:[		
					  { name: '复方甘草口服液复方甘草口服液复方甘草口服液' },
					  { name: '复方甘草口服液复方甘草口服液复方甘草口服液' },
					  { name: '复方甘草口服液复方甘草口服液复方甘草口服液' },
					  { name: '复方甘草口服液复方甘草口服液复方甘草口服液' },
					  { name:'复方甘草口服液复方甘草口服液复方甘草口服液'},
					]
				  }
				]
			}
		},
		onLoad() {

		},
		methods: {
			start_seal(){ 
				this.seal = true;
				if(this.sealname === '发送处方'){
					uni.showModal({
						title: '确认发送处方',
						content: '您确定要发送该处方？',
						success: function (res) {
							if (res.confirm) {
								console.log('用户点击确定');
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				} 
				this.sealname = '发送处方';
			} 
		}
	}
</script>

 
<style>
	.prescription{
	  padding: 30rpx;
	  box-sizing: border-box;
	  font-weight:bold;
	}
	.prescription_con{
	  background: #f9fcfd;
	  padding: 20rpx 30rpx;
	  box-sizing: border-box;
	}
	.prescription_con .bumber_top{
	  font-size: 26rpx;
	}
	.prescription_con_title{
	  text-align: center;
	  font-weight:bold;
	  font-size: 32rpx;
	}
	.prescription_info{
	  border-bottom: 5rpx solid #333;
	  margin: 0 30rpx;
	  padding: 20rpx 0;
	}
	.prescription_info text{
	  width: 33.33%;
	  display: inline-block;
	  font-size: 24rpx;
	  line-height: 25rpx;
	}
	.prescription_info text:nth-child(3){
	  text-align: right
	}
	.prescription_info text:nth-child(2){
	  text-align: center
	}
	.prescription_info text:last-child{
	  float: right;
	  text-align: right
	}
	.prescription_con_middle{
	  padding: 0 30rpx;
	  min-height: 400rpx;
	  
	}
	.prescription_con_middle .r{
	  font-size: 44rpx;
	}
	.prescription_con_middle .con_middle_li{
	  padding: 10rpx 50rpx;
	  font-size: 22rpx;
	}
	.con_middle_li text{
	  display: inline-block;
	  overflow: hidden;
	  text-overflow: ellipsis;
	  white-space: nowrap;
	}
	.con_middle_li text:first-child{
	  width: 70%;
	  padding-right: 20rpx;
	  box-sizing: border-box;
	}
	.con_middle_li text:nth-child(2){
	  float: right;
	  width: 30%;
	  box-sizing: border-box;
	}
	.con_middle_li text:nth-child(3){
	  text-align: right;
	  width: 100%;
	}
	/* 盖章 */
	.prescription_seal{
	  padding: 10rpx 30rpx 0;
	  border-bottom: 2px solid #333333;
	  height: auto;
	  overflow: hidden;
	  box-sizing: border-box;
	}
	.prescription_seal_li{
	  width: 50%;
	  display: flex;
	  align-items: center;
	  float: left;
	  font-size: 24rpx;
	  padding:10rpx 0;
	  overflow: hidden;
	  height: 110rpx;
	}
	.prescription_seal_li text{
	  display: inline-block;
	  font-weight:bold;
	}
	.prescription_seal_li .seal{
		border: 6rpx solid #ff0000;
		padding: 5rpx 15rpx 10rpx;
		box-sizing: border-box;
		
	}
	.prescription_seal_li .seal text{
	  display: block;
	  text-align: center;
	  color: #ff0000;
	  font-weight: normal;
	  font-size: 20rpx;
	}
	.prescription_seal_li .seal text:first-child{
	  font-weight:bold;
	  font-size: 26rpx;
	}
	.prescription_seal_li .qy text:first-child
	{
	  border-bottom:1px solid #666666;
	 
	}
	.prescription_seal_li .qy text{
	  font-size: 24rpx;
	}
	.prescription_seal_li .qy{
	  width: 72rpx;
	}
	.prescription_seal_li .title{
	  width: 72rpx;
	}
	.prescription_single_B{
	  padding-top: 10rpx;
	  
	}
	.prescription_single_B text{
	  font-size: 22rpx;
	  display: inline-block;
	  line-height: 35rpx;
	  font-weight:bold;
	}
	.generate_button{
	  margin: 40rpx 60rpx;
	  background: #108ec9;
	  line-height: 85rpx;
	  height: 85rpx;
	  color: #fff;
	  font-size: 30rpx;
	  font-weight: normal;
	}
</style>
